package com.augurit.wf.jbpmex.assignee;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;

import com.augurit.common.system.convert.OmPositionConverter;
import com.augurit.common.system.web.org.form.AcRoleForm;
import com.augurit.common.system.web.org.form.OmOrgForm;
import com.augurit.common.system.web.org.form.OmPositionForm;
import com.augurit.common.system.web.org.form.OmUserForm;
import com.augurit.common.util.lang.CollectionUtils;

public interface IAssigneeParser {

	public String[] parseToUserKeys(String assignee);
	
	/**
	 * 返回复合表达式无重复用户userkey数组
	 * @param assignee，格式为：USER#100,ROLE#1000,...
	 * @return
	 */
	public String[] convertToUserKeys(String assignee);
	
	public String[] parseToOriginalNames(String assignee);
	
	/**
	 * 解析单个的assignee="wukq"或者assignee="$ROLE.dept_manager"
	 * @param assignee
	 * @return
	 */
	public Set<String> parseUserKeysBySingleAssignee(String assignee);
	
	/**
	 * 解析单个的assignee
	 * @param assignee 例如：USER#100 或 ROLE#1000
	 * @return
	 */
	public Set<String> convertToUserKeysBySingleAssignee(String assignee);
	
	public String parseOrginalNamesBySingleAssignee(String assignee);
	
	/**
	 * assignee="$Role.dept_manager"
	 * @return
	 */
	public Set<String> parseUserKeysByRoleAssignee(String assignee);
	
	/**
	 * assignee="Role#1000"
	 * @return
	 */
	public Set<String> convertToUserKeysByRoleAssignee(String assignee);
	
	public AcRoleForm parseRole(String assignee);
	
	public AcRoleForm convertToRole(String assignee);
	
	public String parseRoleName(String assignee);
	
	/**
	 * assignee="USER#100"
	 * @return
	 */
	public Set<String> convertToUserKeysByUserAssignee(String assignee);

	public OmUserForm convertToUser(String assignee);
	
	/**
	 * 解析机构任务分配表达式的用户loginName列表,例子assignee="$ORG.O_zjb"
	 * @return
	 */
	public Set<String> parseUserKeysByOrgAssignee(String assignee);
	
	/**
	 * assignee格式如"ORG#10000"
	 * @return
	 */
	public Set<String> convertToUserKeysByOrgAssignee(String assignee);
	
	public OmOrgForm parseOrg(String assignee);
	
	public OmOrgForm convertToOrg(String assignee);
	
	public String parseOrgName(String assignee);
	
	
	/**
	 * 解析岗位任务分配表达式的用户loginName列表,例子assignee="$POS.P_zjlzl"
	 * @return
	 */
	public Set<String> parseUserKeysByPosAssignee(String assignee);
	
	/**
	 * assignee如"POS#10"
	 * @return
	 */
	public Set<String> convertToUserKeysByPosAssignee(String assignee);
	
	public OmPositionForm parsePos(String assignee);
	
	public OmPositionForm convertToPos(String assignee);
	
	public String parsePosName(String assignee);

	public String getUserNameByUserKey(String userKey);

	/**
	 * 将assignee格式化,以便解析获取userId
	 */
    public String formatAssignee(String assignee);
    
  //根据表达式获取他们的手机电话号码
	public List<String> getMobilePhoneNos(String assignee);
}
